<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends BaseController {
    public function index(){
        $this->login_verify();
        $index=M('index');
        $indexinfo=$index->select();
        $this->assign('indexinfo',$indexinfo[0]);
        $this->display();
    }
    public function indexSet(){
    	// var_dump($_POST);
    	$index = M("index");
		// 要修改的数据对象属性赋值
		$data['title'] = $_POST['title'];
		$result=$index->where('Id=1')->save($data);
        if($result){
    		$this->success('设置成功', U('Index/index'));
    	}else{
    		$this->error('设置失败');
    	}
    }
}